#coding=utf-8
from django import forms

class HostAddForm(forms.Form):
    ip = forms.IPAddressField(label='主机IP')
    port = forms.CharField(max_length=5,label='端口')
    user = forms.CharField(max_length=50,label='用户')
    passwd = forms.CharField(max_length=100,label='密码',widget=forms.PasswordInput())
    protocol_type = forms.ChoiceField(choices=[('SSH','SSH'),('KEY','KEY')])
    hostname = forms.CharField(max_length=50,required=False,label='主机名')
    system = forms.CharField(max_length=50,required=False,label='操作系统')
    server_models = forms.CharField(max_length=50,required=False,label='服务器型号')
    cpu = forms.CharField(max_length=50,required=False,label='CPU型号')
    cpumun = forms.CharField(max_length=50,required=False,label='CPU核数')
    hmem = forms.CharField(max_length=50,required=False,label='物理内存')
    vmem = forms.CharField(max_length=50,required=False,label='虚拟内存')
    disk = forms.CharField(max_length=50,required=False,label='硬盘容量')
    alias = forms.CharField(max_length=50,required=False,label='别名')
class GroupAddForm(forms.Form):
    group_name = forms.CharField(label='组名')

class HostAddsForm(forms.Form):
    info = forms.CharField(max_length=2000,label='内容',widget=forms.Textarea)
    
#class CmdForm(forms.Form):
#    cmd = forms.CharField(max_length=500,label='命令')

class SaltCmdForm(forms.Form):
    saltcmd = forms.CharField(max_length=500,label='命令')

class MoreCmdForm(forms.Form):
    keyword = forms.CharField(max_length=50,required=False,label='关键字')
    morecmd = forms.CharField(max_length=500,label='命令')

class AddServerForm(forms.Form):
    sname = forms.CharField(max_length=100,label='服务名')
    spath = forms.CharField(max_length=100,label='脚本路径')

class MServerForm(forms.Form):
    mname = forms.CharField(max_length=100,label='服务名')
    mstart = forms.CharField(max_length=200,label='启动命令')
    mrestart = forms.CharField(max_length=200,label='重启命令')
    mstop = forms.CharField(max_length=200,label='停止命令')

class CodeupForm(forms.Form):
    File = forms.FileField(label='选择文件',required=False)
    
class CodeserverForm(forms.Form):
    ip = forms.IPAddressField(label='主机IP')
    backuppath = forms.CharField(label='备份文件存放的目录路径')
    backdir = forms.CharField(label='需要被备份的文件夹')
    path = forms.CharField(label='文件服务器路径')

class UserForm(forms.Form):
    user = forms.CharField(label = '用户名')
    passwd = forms.CharField(label = '密码')
    name = forms.CharField(label = '姓名')
#    post = forms.CharField(label = '职位')
    phone = forms.CharField(label = '电话')
    email = forms.EmailField(label = '邮箱')
    qq = forms.CharField(label = 'QQ号')

class TaskForm(forms.Form):
#    task_name = forms.CharField(label = '任务名称')
    content = forms.CharField(widget=forms.Textarea,label = '任务内容')
#    completion_time = forms.DateTimeField(label = '规则完成任务的时间')

class loginForm(forms.Form):
    username = forms.CharField(label = '用户名')
    password = forms.CharField(label = '密码',widget=forms.PasswordInput())
    
#class TaskCommentsForm(forms.Form):
#	content = forms.CharField(label = '回复内容',widget=forms.Textarea)

    
class ConfigForm(forms.Form):
    mailsmtp = forms.CharField(label = '邮件mtp服务器地址')
    mailuser = forms.CharField(label = '发送者邮件用户名')
    mailpass = forms.CharField(label = '发送者邮件密码')
    mailfrom = forms.CharField(label = '发送者邮件地址')

class DepartmentForm(forms.Form):
    name = forms.CharField(label = '部门名')

class UsergroupForm(forms.Form):
    name = forms.CharField(label = '职位名')
